#include <bits/stdc++.h>
using namespace std;
string s, t;
const int MAX = 1010;
int ans;
int num[MAX];
int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    freopen("neck.in", "r", stdin);
    freopen("neck.out", "w", stdout);
    cin >> s >> t;
    if (s[0] == t[0])
        num[0] = 1;
    for (int i = 1; i < s.size(); i++)
    {
        if (s[i] == t[0])
            num[i] = num[i - 1] + 1;
        if (num[i] >= t.size())
            ans++;
    }
    cout << s.size() - ans;
}